package com.hanfengyi.feign;

import com.hanfengyi.course.domain.CourseType;
import com.hanfengyi.course.temp.CourseNativeSearchQueryBuilder;
import com.hanfengyi.doc.CourseDoc;
import com.hanfengyi.feign.fallback.ESFeignFallbackFactory;
import com.hanfengyi.hrm.AjaxResult;
import com.hanfengyi.hrm.PageList;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "es-server" ,fallbackFactory = ESFeignFallbackFactory.class)
public interface ESFeignClient{
    @GetMapping("/es/get/{id}")
    AjaxResult deleteById(@PathVariable("id") Long id);
    @PostMapping("/es/save")
    AjaxResult save(@RequestBody CourseDoc courseDoc);

    @PostMapping("/es/searchByQuery")
    PageList<CourseType> searchByQuery(@RequestBody CourseNativeSearchQueryBuilder courseNativeSearchQueryBuilder);
}
